package com.innover.activemq.consumer;

import org.springframework.beans.factory.annotation.Autowired;

import javax.jms.BytesMessage;
import javax.jms.Message;
import javax.jms.MessageListener;

/**
 * Created by James on 8/8/2017.
 */
public class Consumer implements MessageListener {

    @Autowired
    private ConsumerOnMessage consumerOnMessage;

    @Override
    public void onMessage(Message message) {
        if (message instanceof BytesMessage){
            BytesMessage bm = (BytesMessage) message;
            consumerOnMessage.processMessage(bm);
        }
    }
}
